#include<bits/stdc++.h>
using namespace std;

int main() {
	
	int cms_Chinese , cms_Math ; 
	
	cin >> cms_Chinese >> cms_Math ;
	
	if ((cms_Chinese >= 60 && cms_Math < 60) || (cms_Math >= 60 &&  cms_Chinese< 60) )
	{
		
		cout <<"1";
		
	}
	else {
		
		cout <<"0";
		
	}
	return 0;
}

